<?php

namespace App\Http\Controllers\QH_Api;

use App\Http\Controllers\TK_Api\ApiBaseController;
use App\Models\Qh_Notice;
use Illuminate\Http\JsonResponse;

class NoticeController extends ApiBaseController
{
    /**
     * 列表
     * @return JsonResponse|object
     */
    public function list() {
        $list = Qh_Notice::filter(request()->all())->orderByDesc('id')->paginate(request('perPage', 10));

        return $this->restful($list);
    }


    /**
     * 详情
     * @param $id
     * @return JsonResponse|object
     */
    public function show($id) {
        $notice = Qh_Notice::findOrFail($id);

        return $this->restful($notice);
    }
}
